﻿using System.Text;
using UnityEngine;
using Yoozoo.Core.Extensions.CSharp;

namespace Yoozoo.Art
{
    public class LodSetting
    {
        public float[] Distances;
    }


    /// <summary>
    /// 批量设置LOD Group
    /// </summary>
    public class BatchSetLodGroup : MonoBehaviour
    {
        public float LodBias = 0.4f;

        /// <summary>
        /// 摄像机
        /// </summary>
        public Camera Camera;

        /// <summary>
        /// 根据距离设置LOD
        /// </summary>
        public float[] Distances;

        /// <summary>
        /// 该目录下的所有预制体都设置
        /// </summary>
        public string Path;

        public string TestAssetPath;

        public Renderer[] Renderers;

        private StringBuilder stringBuilder = new StringBuilder();

        void Update()
        {
            if (Renderers.IsEmpty())
                return;

            stringBuilder.Length = 0;
            foreach (var r in Renderers)
            {
                stringBuilder.AppendFormat("{0}.isVisible: {1}\n", r.name, r.isVisible);
            }
            UnityEngine.Debug.Log(stringBuilder.ToString());
        }
    }
}
